﻿using Common.Interfaces;
using Microsoft.Extensions.Caching.Memory;
namespace Common.Caching;

public interface ICacheService
{
    T Get<T>(string key);
    void Set<T>(string key, T value, TimeSpan expiration);
    void Remove(string key); // 添加移除缓存项的方法
    Task<T> GetOrAddAsync<T>(string key, Func<Task<T>> addItemFactory, MemoryCacheEntryOptions? policy = null);
}
